<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@include file="/context/mytags.jsp"%>
<t:base type="jquery,easyui,tools,DatePicker"></t:base>
<div class="easyui-layout" fit="true">
  <div region="center" style="padding:0px;border:0px">
  <t:datagrid pageSize="100" name="businessUserMapList" checkbox="true" pagination="true" fitColumns="true" title="领用人列表" sortName="createDate" actionUrl="businessUserMapController.do?datagrid" idField="id" fit="true" queryMode="group">
   <t:dgCol title="主键"  field="id"  hidden="true"  queryMode="single"  width="120"></t:dgCol>
   <t:dgCol title="创建人名称"  field="createName"  hidden="true"  queryMode="single"  width="120"></t:dgCol>
   <t:dgCol title="创建人登录名称"  field="createBy"  hidden="true"  queryMode="single"  width="120"></t:dgCol>
   <t:dgCol title="创建日期"  field="createDate"  formatter="yyyy-MM-dd"  hidden="true"  queryMode="single"  width="120"></t:dgCol>
   <t:dgCol title="更新人名称"  field="updateName"  hidden="true"  queryMode="single"  width="120"></t:dgCol>
   <t:dgCol title="更新人登录名称"  field="updateBy"  hidden="true"  queryMode="single"  width="120"></t:dgCol>
   <t:dgCol title="更新日期"  field="updateDate"  formatter="yyyy-MM-dd"  hidden="true"  queryMode="single"  width="120"></t:dgCol>
   <t:dgCol title="频道"  field="sysOrgCode"    queryMode="single"  width="120"></t:dgCol>
   <t:dgCol title="栏目"  field="sysCompanyCode"    queryMode="single"  width="120"></t:dgCol>
   <t:dgCol title="用户姓名"  field="userName"  queryMode="single"  width="120"></t:dgCol>
   <t:dgCol title="汇款地址/账号"  field="costAddr"   queryMode="single"  width="120"></t:dgCol>
   <t:dgCol title="卡号"  field="userCard"  queryMode="single"  width="120"></t:dgCol>
   <t:dgCol title="备注"  field="remark"  queryMode="single"  width="120"></t:dgCol>
   <%--<t:dgCol title="操作" field="opt" width="100"></t:dgCol>--%>
   <t:dgToolBar title="删除"  icon="icon-remove" url="businessUserMapController.do?doBatchDel" funname="deleteALLSelect"></t:dgToolBar>
   <t:dgToolBar title="录入" icon="icon-add" url="businessUserMapController.do?goAdd" funname="add"></t:dgToolBar>
	<%--<t:dgToolBar title="编辑" icon="icon-edit" url="businessUserMapController.do?goUpdate" funname="update"></t:dgToolBar>
  <t:dgToolBar title="查看" icon="icon-search" url="businessUserMapController.do?goUpdate" funname="detail"></t:dgToolBar> --%>
  </t:datagrid>

   <div id="businessUserMapListtb" style="padding: 3px;">
    <div align="right" class="searchColums">
     <label for="sysOrgCode" class="col-sm-2 control-label">频道: </label>
     <select name="sysOrgCode" id="sysOrgCode" class="form-control" onchange="changeOrgCode(this.value)" value="${sysOrgCode}"></select>
     <label for="sysCompanyCode" class="col-sm-2 control-label">栏目： </label>
     <select name="sysCompanyCode" id="sysCompanyCode" class="form-control" value="${sysCompanyCode}"></select>
     <label for="userName" class="col-sm-2 control-label">用户姓名： </label>
     <input onkeypress="EnterPress(event)" onkeydown="EnterPress()"
            type="text" name="userName" style="width: 120px"
            class="inuptxt">
     <label for="userCard" class="col-sm-2 control-label">卡号： </label>
     <input onkeypress="EnterPress(event)" onkeydown="EnterPress()" type="text"
            name="userCard" style="width: 120px" class="inuptxt">
     <a href="#" class="easyui-linkbutton" iconCls="icon-search" onclick="businessUserMapListsearch();">查询</a>

    </div>
   </div>
  </div>
 </div>
 <script type="text/javascript">
  var company;
  $(document).ready(function () {
   $.ajax({
    url: "businessOrderController.do?getDeptList",
    type: "GET",
    dataType: "JSON",
    async: false,
    success: function (data) {
     if (data.success) {

      var dept = data.attributes.dept;
      var top;
      if (dept.length > 0) {
       var opt1 = new Option("全部", "");
       document.getElementById('sysOrgCode').options.add(opt1);
       for (var i = 0; i < dept.length; i++) {
        var opt = new Option(dept[i].name, dept[i].code);
        document.getElementById('sysOrgCode').options.add(opt);
        if (i == 0) {
         //top = dept[i].code;
        }
       }
      }
      company = data.attributes.comp;
      if (company.length > 0) {
       var opt1 = new Option("全部", "");
       document.getElementById('sysCompanyCode').options.add(opt1);
       for (var i = 0; i < company.length; i++) {
        if (top == company[i].parentCode) {
         var opt = new Option(company[i].name, company[i].code);
         document.getElementById('sysCompanyCode').options.add(opt);
        }
       }
      }
     }
    }
   });
  });

  function changeOrgCode(parentCode) {
   document.getElementById('sysCompanyCode').length = 0;
   if (company.length > 0) {
    var opt1 = new Option("全部", "");
    document.getElementById('sysCompanyCode').options.add(opt1);
    for (var i = 0; i < company.length; i++) {
     if (parentCode == company[i].parentCode) {
      var opt = new Option(company[i].name, company[i].code);
      document.getElementById('sysCompanyCode').options.add(opt);
     }
    }
   }
  }
   
 
//导入
function ImportXls() {
	openuploadwin('Excel导入', 'businessUserMapController.do?upload', "businessUserMapList");
}

//导出
function ExportXls() {
	JeecgExcelExport("businessUserMapController.do?exportXls","businessUserMapList");
}

//模板下载
function ExportXlsByT() {
	JeecgExcelExport("businessUserMapController.do?exportXlsByT","businessUserMapList");
}

 </script>
